package com.lyn.solitude.plugin.dialog

import android.app.Dialog
import android.content.Context
import android.os.Bundle
import androidx.viewbinding.ViewBinding
import com.lyn.solitude.plugin.R

/**
 *
 * @author longyn 2024/05/16
 * @version 1.0.0
 */
abstract class BaseDialog<V : ViewBinding>(
    private val context: Context,
    private val style: Int = R.style.common_dialog
) :
    Dialog(context, style) {

    lateinit var binding: V

    abstract fun getViewBinding(): V

    override fun onCreate(savedInstanceState: Bundle?) {
        super.onCreate(savedInstanceState)
        binding = getViewBinding()
        setContentView(binding.root)
    }
}